package com.sys.basics.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import com.sys.basics.entity.SysAttachment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: ares
 * @date: 2021-10-08
 * @description: 附件资源表 Mapper 接口
 */
@Mapper
public interface SysAttachmentDao extends BaseMapper<SysAttachment> {

    IPage<SysAttachment> getPages(Page<SysAttachment> page, @Param("attachment") SysAttachment attachment);

    SysAttachment getTreeById(Long id);

    List<SysAttachment> getChildrenByParentId(Long parentId);

    List<SysAttachment> getChildrenTreeByParentId(Long parentId);

    List<SysAttachment> getDirectoryTreeByParentId(Long parentId);

    SysAttachment getDirectoryByName(@Param("parentId") Long parentId, @Param("name") String name);

    boolean batchMove(@Param("id") Long id, @Param("attachmentIds") List<Long> attachmentIds);
}
